From d140759ea539c43f3b9a50b37719b34b58ba430e Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sat, 12 Nov 2022 10:41:40 +0100 Subject: match view: toggle sidebar --- web/pw-server/src/routes/matches/[match_id].svelte | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'web/pw-server/src/routes/matches/[match_id].svelte') diff --git a/web/pw-server/src/routes/matches/[match_id].svelte b/web/pw-server/src/routes/matches/[match_id].svelte index bbb25e1..653b3bf 100644 --- a/web/pw-server/src/routes/matches/[match_id].svelte +++ b/web/pw-server/src/routes/matches/[match_id].svelte @@ -29,6 +29,7 @@ export let matchLog: string | undefined; export let matchData: object; + let showSidebar = true; onMount(async () => { const apiClient = new ApiClient(); @@ -54,6 +55,10 @@ return matchPlayer["owner_id"] === user?.["user_id"]; } + function toggleSidebar() { + showSidebar = !showSidebar; + } + // using the same value here causes svelte to freeze let dropdownSelectedPlayer: any; let selectedPlayer: any; @@ -65,8 +70,14 @@
- - {#if playersWithVisibleLog.length > 0} + +
+ {#if playersWithVisibleLog.length > 0} +
toggle sidebar
+ {/if} +
+
+ {#if showSidebar && playersWithVisibleLog.length > 0}
{#if playersWithVisibleLog.length == 1} @@ -126,4 +137,9 @@ flex-direction: column; background-color: variables.$bg-color; } + + .toggle-sidebar:hover { + cursor: pointer; + color: #ccc; + } -- cgit v1.2.3